define(['jquery'], function ($) {
    var Controller = {

        //是否已登陆，1已登陆，0未登陆
        logined: Config.logined,

        //跨站令牌
        cross_site_token: Config.cross_site_token,

        //回调地址
        callback_url: "",

        //打开登陆窗口
        openLoginWindow: function () {
            Fast.api.open("/index/ai/loginpop", "请登陆", {
                shadeClose: false,
                shade: [0.7, '#393D49'],
                area: ['500px', '330px'],
                maxmin: false,
                closeBtn: 0,
                callback: function (value) {
                    console.log(value);
                    if (value.code == "1") {

                        Controller.logined = 1;
                        Controller.cross_site_token = value.cross_site_token;
                        console.log("loginpop.cross_site_token", value.cross_site_token);

                        //如果设置了回调的url
                        if (Controller.callback_url != "") {
                            window.location = Controller.callback_url;
                        }
                    }
                }
            });
        },
    };
    return Controller;
});
